<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>新增编辑管理员</title>
</head>
<body>
<div class="pd-20">
	<form action="<%=path%>/backstage/t_user_admin-add" method="post" class="form form-horizontal" id="form-t_user_admin-add">
		<input type="hidden" id="id" name="id" value='${t_user_admin.user_id}' />
        
        <div class="row cl">
			<label class="form-label col-2">用户名：</label>
            <div class="formControls col-2">
                <input type="text" class="input-text" value="${t_user_admin.user_name}" placeholder="" id="" name="user_name" datatype="*" nullmsg="不能为空">
        	</div>
		</div>
        <div class="row cl">
			<label class="form-label col-2">真实姓名：</label>
            <div class="formControls col-4">
                <input type="text" class="input-text" value="${t_user_admin.true_name}" placeholder="" id="" name="true_name" datatype="*" nullmsg="不能为空">
        	</div>
		</div>
		 <div class="row cl">
			<label class="form-label col-2">分站县市：</label>
			<div class="formControls col-2">
				<span class="select-box">
					<select name="city_id" class="select" datatype="*" nullmsg="请选择分站县市">
						<option <c:if test="${t_user_admin.city_id==-1}">selected</c:if> value="-1">总部</option>
						<c:forEach items="${citys}" var="city">
						<option value="${city.id}" <c:if test="${city.id==t_user_admin.city_id}">selected</c:if> >${city.name}</option>
						</c:forEach>
					</select>
				</span>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">角色：</label>
			<div class="formControls col-2">
				<span class="select-box">
					<select name="role_id" class="select" datatype="n" nullmsg="请选择角色">
						<c:forEach items="${roles}" var="role">
						<option value="${role.role_id}" <c:if test="${role.role_id==t_user_admin.role_id}">selected</c:if> >${role.role_name}</option>
						</c:forEach>
					</select>
				</span>
			</div>
		</div>
        <div class="row cl">
			<label class="form-label col-2">登录密码：</label>
            <div class="formControls col-3">
                <input type="password" class="input-text" value="${t_user_admin.password}" placeholder="" id="" name="password" datatype="*" nullmsg="不能为空">
        	</div>
		</div>

		<div class="row cl">
			
		  <label class="form-label col-2">是否系统管理员：</label>
		  <div class="formControls col-6 skin-minimal">
			<div class="radio-box">
			  <input type="radio" name="is_super" datatype="*" nullmsg="请选择！" value="0" checked="true" <c:if test='${0==t_user_admin.is_super}'>checked="true"</c:if> >
			  <label for="sex-1">否</label>
			</div>
			<div class="radio-box">
			  <input type="radio"  name="is_super" datatype="*" nullmsg="请选择！" value="1" <c:if test='${1==t_user_admin.is_super}'>checked="true"</c:if> >
			  <label for="sex-2">是</label>
			</div>
		  </div>

		</div>


		<div class="row cl">
			<div class="col-10 col-offset-2">
				<button onClick="t_user_admin_save_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i>保存</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>
</div>
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script> 
<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="lib/Validform/5.3.2/Validform.min.js"></script> 
<script type="text/javascript" src="lib/webuploader/0.1.5/webuploader.min.js"></script> 
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" src="lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script> 
<script type="text/javascript">

function t_user_admin_save_submit(){
	var subForm = $("#form-t_user_admin-add").Validform({
		tiptype:2,
		ajaxPost:true,
		callback:function(form){
			if (form.error == "0000"){
				var index = parent.layer.getFrameIndex(window.name);
				if (index){//关闭弹出层
					parent.$('.btn-refresh').click(); 
					parent.layer.close(index);
				}else{//单独的页面
					
					location.href = "<%=path%>/backstage/t_user_admin-list"; 
				}
			}else{
				layer.alert(form.information, {icon:5});
			}
			
		}
	});
}

</script>
</body>
</html>

